package com.twu.biblioteca;

public class Book {

    private static final String LIBRARY = "Library";
    private String title;
    private String patron;

    public Book(String title) {
        this.title = title;
        this.patron = LIBRARY;
    }

    public Book(String title, String patron) {
        this.title = title;
        this.patron = patron;
    }

    public String toString() {
        return title;
    }

    public void checkOut(String patron) {
        setPatron(patron);
    }

    public String getTitle() {
        return title;
    }

    public boolean available() {
        if (patron.equals(LIBRARY)) {
            return true;
        } else {
            return false;
        }
    }

    private void setPatron(String patron) {
        this.patron = patron;
    }

    public String getPatron() {
        return patron;
    }

    public void checkIn() {
        patron = LIBRARY;
    }
}
